#region Usings

using System;
using System.Collections.Generic;
using Castle.ActiveRecord;
using Karma.Framework.Core.Domain;

#endregion

namespace Karma.Framework.Core.Metadata.Mapping
{
    [ActiveRecord("[Module]")]
    public class Module : DomainObject
    {
        [JoinedKey]
        public override Int64 Id { get; set; }

        [Property(NotNull = true)]
        public string Description { get; set; }

        [Property(NotNull = true)]
        public string Licencia { get; set; }

        [Property(Column="[Key]", NotNull = true, Unique = true, UniqueKey = "Mdulo_Key")]
        public string Key { get; set; }

        [Property(NotNull = true)]
        public string Name { get; set; }

        [HasMany(typeof(Entity), ColumnKey = "[Module]", Cascade = ManyRelationCascadeEnum.All,
            Lazy = false, Table = "[Entity]")]
        public IList<Entity> Entities { get; set; }
    }
}